<!--
 * @Description: 
 * @Autor: 商晓彬
 * @Date: 2021-09-02 11:20:05
 * @LastEditors: 商晓彬
 * @LastEditTime: 2021-12-21 08:58:38
-->
<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="add modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div style="width:1244px!important;margin: 1.75rem auto;">
        <div class="modal-content">
            <form *ngIf="active" #bopForm="ngForm" novalidate autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>驳回出库</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body" style="height: 733px!important;overflow: auto; width: 100%;">
                    <div class="p-formgroup-inlined flex " *ngIf="checktype !=1 && checktype !=2">
                        <div class="flex">
                            <label style="margin-top: 5px;">放行单号：</label>
                            <p-dropdown filter="true" name="releaseOrder" [options]="releaseOrderOptions"
                                placeholder="请选择放行单号" [(ngModel)]="queryInfo.releaseOrder" emptyFilterMessage="暂无数据">
                                <ng-template let-item pTemplate="selectedItem">
                                    <span
                                        style="vertical-align:middle; margin-left: .5em;width: 147px;">{{item.label}}</span>
                                </ng-template>
                                <ng-template let-model pTemplate="item">
                                    <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                        <div style="font-size:14px;float:right;margin-top:4px;width: 147px;">
                                            {{model.label}}
                                        </div>
                                    </div>
                                </ng-template>
                            </p-dropdown>
                        </div>
                        <div class="flex">
                            <label style="margin-top: 5px;margin-left: 10px;">合格证号：</label>
                            <p-dropdown filter="true" name="qualifiedNumber" [options]="qualifiedNumberOptions"
                                placeholder="请选择合格证号" [(ngModel)]="queryInfo.qualifiedNumber" emptyFilterMessage="暂无数据">
                                <ng-template let-item pTemplate="selectedItem">
                                    <span
                                        style="vertical-align:middle; margin-left: .5em;width: 147px;">{{item.label}}</span>
                                </ng-template>
                                <ng-template let-model pTemplate="item">
                                    <div class="ui-helper-clearfix" style="position: relative;height: 25px;">
                                        <div style="font-size:14px;float:right;margin-top:4px;width: 147px;">
                                            {{model.label}}
                                        </div>
                                    </div>
                                </ng-template>
                            </p-dropdown>
                        </div>
                        <button pButton type="button" label="查询" (click)="getCertificateByNumEv()"
                            style="margin-left: 1.5rem"></button>
                        <button pButton type="button" label="重置" (click)="resert()"
                            style="margin-left: 1.5rem"></button>
                    </div>
                    <div *ngIf="checktype ==1 ||checktype ==2">
                        <span>
                            <label style="margin-top: 5px;">放行单号：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="releaseOrder"
                                type="text" [(ngModel)]="queryInfo.releaseOrder" />
                        </span>
                        <span>
                            <label style="margin-top: 5px;">合格证号：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="qualifiedNumber"
                                type="text" [(ngModel)]="queryInfo.qualifiedNumber" />
                        </span>
                    </div>
                    <hr style="border: 0.5px solid #DDDDDD;">
                    <div class="p-formgroup-inline flex">
                        <div class="flex">
                            <label style="margin-top: 5px;">产品图号：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;"
                                name="productDrawingNos" type="text" [(ngModel)]="form.productDrawingNo" />
                        </div>
                        <div class="flex">
                            <label style="margin-top: 5px;">产品名称：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="productNames"
                                type="text" [(ngModel)]="form.productName" />
                        </div>
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">批次：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="batchs"
                                type="text" [(ngModel)]="form.batch" />
                        </div>
                        <div class="flex">
                            <label style="margin-top: 5px;">合格证任务号：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;"
                                name="qualifiedTaskNumber" type="number" [(ngModel)]="form.qualifiedTaskNumber" />
                        </div>
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">阶段标记：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="stageMark"
                                type="text" [(ngModel)]="form.stageMark" />
                        </div>
                    </div>
                    <div class="p-formgroup-inline flex mt">
                        <div class="flex">
                            <label class="lwid">*型号(产品代号):</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="productCode"
                                type="text" [(ngModel)]="form.productCode" />
                        </div>
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">*发次：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="sendTime"
                                type="text" [(ngModel)]="form.sendTime" />
                        </div>
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">*物料类别:</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="materialsNode"
                                type="text" [(ngModel)]="form.materialsNodeDesc" />
                        </div>
                        <div class="flex">
                            <label style="margin-top: 5px;width: 91px;">*物料细类:</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;"
                                name="materialCategory" type="text" [(ngModel)]="form.materialCategoryDesc" />
                        </div>
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">规格：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="Module"
                                type="text" [(ngModel)]="form.module" />
                        </div>
                    </div>
                    <div class="p-formgroup-inline flex mt">
                        <div class="flex time">
                            <label class="lwid" style="margin-top: 5px;">有效期止:</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="expirationDates"
                                type="text" [(ngModel)]="form.expirationDate" />
                        </div>
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">*单位：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="units"
                                type="text" [(ngModel)]="form.unit" />
                        </div>
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">储位：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="binLocations"
                                type="text" [(ngModel)]="form.binLocation" />
                        </div>
                    </div>
                    <div class="p-formgroup-inline flex mt">
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">数量：</label>
                            <input disabled style=" width:150px;height: 35px;margin-right: 10px;" name="quantity"
                                type="text" [(ngModel)]="form.quantity" />
                        </div>
                        <div class="flex">
                            <label class="lwid">产品编号(件号):</label>
                            <input disabled style=" width:375px;height: 70px;margin-right: 10px;" name="productNumber"
                                type="text" [(ngModel)]="form.productNumber" />
                        </div>
                        <div class="flex">
                            <label style="margin-top: 5px;width: 91px;">特殊记载：</label>
                            <textarea rows="5" cols="30" disabled style=" width:375px;height: 70px;margin-right: 10px;" name="specialRecords"
                                type="text" [(ngModel)]="form.specialRecords" ></textarea>
                        </div>
                    </div>
                    <hr style="border: 0.5px solid #DDDDDD;">
                    <div class="p-formgroup-inline ">
                        <h4>出库信息：</h4>
                    </div>
                    <div class="p-formgroup-inline flex mt">
                        <div class="flex" *ngIf="checktype !=1">
                            <label style="margin-top: 5px;margin-right: 10px;">*驳回人：</label>
                            <!-- <input #modelSelect="ngModel" required disabled style=" width:150px;height: 35px;margin-right: 10px;" name="specialRecords"
                                type="text" [(ngModel)]="inputForm.operationPerson" />
                                <validation-messages [formCtrl]="modelSelect"></validation-messages> -->
                            <p-dropdown filter="true" #inventoryPeopleListSelect="ngModel" name="inventoryPeopleList"
                                [options]="inventoryPeopleList" placeholder="请选择返修人" dataKey="value" filterBy="label"
                                [optionLabel]="'label'" [(ngModel)]="inputForm.operationPerson"
                                emptyFilterMessage="暂无数据">

                            </p-dropdown>
                            <validation-messages [formCtrl]="inventoryPeopleListSelect"></validation-messages>

                        </div>
                        <div class="flex" *ngIf="!dateFlag">
                            <label style="margin-top: 5px;margin-right: 10px;">*驳回日期：</label>
                            <p-calendar [disabled]="checktype ==1" #operationTimeSelect="ngModel" required
                                name="operationTime" [(ngModel)]="inputForm.operationTime" [showIcon]="true" dateFormat="yy-mm-dd">
                            </p-calendar>
                            <validation-messages [formCtrl]="operationTimeSelect"></validation-messages>

                        </div>
                        <div class="flex" *ngIf="dateFlag">
                            <label style="margin-top: 5px;margin-right: 10px;">*驳回日期：</label>
                            <p-calendar [disabled]="checktype ==1" #operationTimeSelect="ngModel" required
                                name="operationTime" [(ngModel)]="operationTime" [showIcon]="true" dateFormat="yy-mm-dd">
                            </p-calendar>
                            <validation-messages [formCtrl]="operationTimeSelect"></validation-messages>

                        </div>

                        <div class="flex">
                            <label style="margin-top: 5px;margin-right: 10px;margin-left: 10px;">*解除配套/与配套关系：</label>
                            <p-toggleButton name="isRelieve" [disabled]="checktype ==1"
                                [(ngModel)]="inputForm.isRelieve" [style]="{'width':'80px'}" onLabel="是" offLabel="否">
                            </p-toggleButton>
                        </div>
                    </div>
                    <div class="p-formgroup-inline flex mt">
                        <div class="flex">
                            <label class="lwid" style="margin-top: 5px;">*驳回原因：</label>
                            <input #remarkSelect="ngModel" required [disabled]="checktype ==1"
                                style=" width:848px;height: 60px;margin-right: 10px;" name="remark" type="text"
                                [(ngModel)]="inputForm.remark" />
                            <validation-messages [formCtrl]="remarkSelect"></validation-messages>
                        </div>
                    </div>
                </div>
                <div *ngIf="checktype !=1 &&checktype !=2" class="modal-footer" style="justify-content: center;">
                    <button pButton type="button" label="取消" (click)="close()"
                        style="margin-left: 0.5rem"></button>
                    <button pButton [disabled]="!bopForm.form.valid" type="button" label="出库" (click)="addStoreOutEv()"
                        style="margin-left: 0.5rem"></button>
                </div>
                <div *ngIf="checktype ==2" class="modal-footer" style="justify-content: center;">
                    <button pButton type="button" label="取消" (click)="close()"
                        style="margin-left: 0.5rem"></button>
                    <button pButton [disabled]="!bopForm.form.valid" type="button" label="保存"
                        (click)="alterCertificateByBusinessEv()" style="margin-left: 0.5rem"></button>
                </div>
            </form>
        </div>
    </div>
</div>